import {myRequest} from '@/utils/http.js'
const getLogin=(data)=>{
	return myRequest({
		url:'/login/login',
		method:'POST',
		data
	})
}

const getRegister=(data)=>{
	return myRequest({
		url:'/login/register',
		method:'POST',
		data
	})
}
//根据登录账号查询
const getUserDetail=(data)=>{
	return myRequest({
		url:'/user/UserList',
		method:'POST',
		data
	})
}
//用户修改信息
const userEdit=(data={})=>{
	return myRequest({
		url:'/user/updateUserInfo',
		method:'POST',
		data
	})
}
//获取分类列表
// const getTypeList=()=>{
// 	return myRequest({
// 		url:'/system/dict/data/type/type',
// 		method:'GET'
// 	})
// }

//根据id搜索，根据昵称搜索
const searchByType=(data={})=>{
	return myRequest({
		url:'/playWith/playList',
		method:'POST',
		data
	})
}

// 上传头像
const headEdit=(data={})=>{
	return myRequest({
		url:'/user/image',
		method:'POST',
		data
	})
}

//下订单
const addOrder=(data={})=>{
	return myRequest({
		url:'/order/saveOrUpdate',
		method:'POST',
		data
	})
}

//修改密码
const editPass=(data={})=>{
	return myRequest({
		url:'/user/updatePassWord',
		method:'POST',
		data
	})
}

//根据id查找订单详情
const orderDetail=(data={})=>{
	return myRequest({
		url:'/order/info',
		method:'POST',
		data
	})
}


//根据用户id获取订单列表
const orderList=(data={})=>{
	return myRequest({
		url:'/order/orderId',
		method:'POST',
		data
	})
}

// 根据id删除订单
const delOrder=(data={})=>{
	return myRequest({
		url:'/order/delete',
		method:'POST',
		data
	})
}

// 主播搜索
export default{
	getLogin,
	getRegister,
	searchByType,
	// getTypeList,
	getUserDetail,
	userEdit,
	headEdit,
	addOrder,
	editPass,
	orderDetail,
	orderList,
	delOrder
}